#!/bin/bash
yum -y install autoconf* automake* bison bison-devel expect flex gcc gcc-c++ gnutls-devel kernel-devel libtermcap-devel libtool* libxml2 libxml2-devel make ncurses ncurses-devel newt newt-devel ntp openssl openssl-devel patch perl wget zlib zlib-devel
cd /opt
wget -O /opt/dahdi-linux-complete-2.6.0+2.6.0.tar.gz http://59.83.33.68/tizone/dahdi-linux-complete-2.6.0+2.6.0.tar.gz
tar zxvf dahdi-linux-complete-2.6.0+2.6.0.tar.gz
cd dahdi-linux-complete-2.6.0+2.6.0
make all
make install
make config
cd /opt/
wget -O /opt/asterisk-1.6.2.24.tar.gz http://59.83.33.68/tizone/asterisk-1.6.2.24.tar.gz
tar zxvf asterisk-1.6.2.24.tar.gz
cd asterisk-1.6.2.24
./configure
wget -O /opt/asterisk-1.6.2.24/makemenu.exp http://59.83.33.68/shell/makemenu.exp
chmod +x /opt/asterisk-1.6.2.24/makemenu.exp
/opt/asterisk-1.6.2.24/makemenu.exp
make all
make install
make samples
make config
cd /opt/
wget -O /opt/asterisk-addons-1.6.2.4.tar.gz http://59.83.33.68/tizone/asterisk-addons-1.6.2.4.tar.gz
tar zxvf asterisk-addons-1.6.2.4.tar.gz
cd asterisk-addons-1.6.2.4
./configure
make all
make install
make samples
cd /opt/
wget -O /opt/chan_ss7-2.1.0.tar.gz http://59.83.33.68/tizone/chan_ss7-2.1.0.tar.gz
tar zxvf chan_ss7-2.1.0.tar.gz
cd chan_ss7-2.1.0
sed -i 's/ASTERISK_PATH=..\/source\/telephony\/asterisk/ASTERISK_PATH=..\/asterisk-1.6.2.24/g' Makefile
sed -i "s/'INCLUDE+=-I..\/source\/telephony\/dahdi\/include'/'INCLUDE+=-I..\/dahdi-linux-complete-2.6.0+2.6.0\/linux\/include'/g" Makefile
make
make install
\cp chan_ss7.so /usr/lib/asterisk/modules/

service dahdi start
dahdi_genconf
service dahdi restart
wget -O /etc/asterisk/ss7.conf http://59.83.33.68/tizone/ss7.conf
sed -i '/HOSTNAME/d' /etc/sysconfig/network
echo HOSTNAME=localhost>>/etc/sysconfig/network
hostname localhost
service asterisk restart
sed -i '/openvox/d' /etc/rc.local
rm /opt/* -rf